package org.anjan.dp.templatemethod;

public abstract class Hoagie {
    final void makeSandwich() {
        cutBun();
        if (customerWantsMeans()) {
            addMeat();
        }
        if (customerWantsCheese()) {
            addCheese();
        }

        if (customerWantsVeggies()) {
            addVeggies();
        }

        if (customerWantsPatty()) {
            addPatty();
        }

        wrap();

    }

    public void cutBun() {
        System.out.println("org.anjan.dp.templatemethod.Hoagie.cutBun");
    }

    public void wrap() {
        System.out.println("org.anjan.dp.templatemethod.Hoagie.wrap");
    }

    public boolean customerWantsMeans() {
        return true;
    }


    public boolean customerWantsCheese() {
        return true;
    }

    public boolean customerWantsVeggies() {
        return true;
    }

    public boolean customerWantsPatty() {
        return true;
    }

    public abstract void addMeat();

    public abstract void addCheese();

    public abstract void addVeggies();

    public abstract void addPatty();
}
